<template>
  <div class="header">
    <div class="header-title v-center">
      注册
    </div>
    <div v-if="level === assistantLevel">
      <el-dropdown class="header-right">
        <span class="el-dropdown-link">
          <svg class="icon " aria-hidden="true">
            <use xlink:href="#icondian2"></use>
          </svg>
        </span>
          <el-dropdown-menu slot="dropdown">
            <router-link to="/userManage">
              <el-dropdown-item>用户管理</el-dropdown-item>
            </router-link>
            <router-link to="/addUser">
              <el-dropdown-item>新增用户</el-dropdown-item>
            </router-link>
          </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import Cookies from 'js-cookie'
export default {
  name: 'BindHeader',
  data () {
    return {
      level: parseInt(Cookies.get('level')),
      assistantLevel: parseInt(this.assistant)
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/varibles.styl"
  .el-dropdown-link {
    cursor: pointer;
  }
  .header
    display flex
    color $headerFontColor
    background $headerBgColor
    position: relative
    line-height: $headerHeight
  .arrow
    color #757575
  .header-left
    margin-left .4rem
    width: .64rem
    float left
    .back-icon
      text-align: center
      font-size: .4rem
  .header-title
    flex: 1
    font-size $headerFontSize
  .header-right
    min-width: 2rem
</style>
